/*
 * $Id: FileDownloadBean.java,v 1.5 2009/10/13 15:28:31 afaichun Exp $
 * 
 * Copyright (C) 2008 General Electric Company. All Rights Reserved.
 * 
 * This software is the confidential and proprietary information of the General
 * Electric Company (GE). You shall not disclose this software and shall use it
 * only in accordance with the terms of the license agreement you entered into
 * with GE.
 * 
 * GE MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
 * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
 * NON-INFRINGEMENT. GE SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE
 * AS A RESULT OF USING, MODIFYING, OR DISTRIBUTING THIS SOFTWARE OR ITS
 * DERIVATIVES.
 */
package com.ge.healthcare.autosc.onwatch.bean;

import com.ge.healthcare.autosc.common.ASCUtil;

/**
 * Java bean for Onwatch file download
 * @author 212042946
 *
 */
public class FileDownloadBean extends BaseInfoBean {

	public static final long serialVersionUID = 0L;
	private String fileName = null;
	private String offset = null;
	
	public String getFileName() {
		return fileName;
	}
	public void setFileName(String fileName) {
		this.fileName = fileName;
	}
	
	public String getOffset() {
		return offset;
	}
	
	public int getOffsetAsInt() {
		if(ASCUtil.isNullOrEmpty(offset)) {
			return 0;
		}
		return Integer.parseInt(offset);
	}
	
	public void setOffset(String offset) {
		this.offset = offset;
	}
	public String toString() {
		StringBuffer str = new StringBuffer();
		str.append(super.toString()).append(",");
		str.append("{download fileName: ").append(getFileName()).append("},");
		str.append("{offset: ").append(getOffset()).append("}");
		return str.toString();
	}
}
